package com.asiainfo.complier.editor;

import javax.swing.undo.AbstractUndoableEdit;
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
import javax.swing.undo.UndoableEdit;

public class CaretUndo extends AbstractUndoableEdit {
	/**
	 * CaretUndo
	 */
	private static final long serialVersionUID = -3333912434322186752L;
	private int start;
	private int end;

	CaretUndo(int start, int end) {
		this.start = start;
		this.end = end;
	}

	public boolean isSignificant() {
		return false;
	}

	public String getPresentationName() {
		return "caret move";
	}

	public void undo() throws CannotUndoException {
		super.undo();

	}

	public void redo() throws CannotRedoException {
		super.redo();

	}

	public boolean addEdit(UndoableEdit edit) {
		if ((edit instanceof CaretUndo)) {
			CaretUndo cedit = (CaretUndo) edit;
			this.start = cedit.start;
			this.end = cedit.end;
			cedit.die();
			return true;
		}

		return false;
	}
}